package com.bruobuqi.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

@RestController
public class AdminController {
    @Autowired
    RestTemplate restTemplate;
    @GetMapping(value = "/hi")
    public String hi(@RequestParam String name) {
        return hiService( name );
    }




        public String hiService(String name) {
            return restTemplate.getForObject("http://service-client/hi?name="+name,String.class);
        }

}
